﻿using Microsoft.EntityFrameworkCore;
using Model.DB;
using NLog;
using System;
using System.Collections.Generic;
using System.Text;

namespace Model
{
    /// <summary>
    /// 数据库连接
    /// </summary>
    public class DBContext : DbContext
    {
        private string connStr = "";

        public DBContext(string conn)
        {
            this.connStr = conn;
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseMySQL(connStr);
        }

        public DbSet<User> user { get; set; }

    }
}
